/*
 * @Date: 2022-03-21 09:49:52
 * @LastEditors: zhaoxm
 * @LastEditTime: 2022-09-02 12:09:04
 * @Description: 正则
 */

/**
 * @description: 是否为金额
 * @param { number|string } value
 * @return { boolean }
 */
export const isAmount = (value) => {
  const reg =
    /(?:^[1-9](\d+)?(?:\.\d{1,2})?$)|(?:^0$)|(?:^\d\.\d\d?$)/
  return reg.test(String(value))
}

export const isUnlimitedInputValue = (value) => {
  const reg =
    /[^\w !"#$%&'()*,./:;<=>?@[\\\]^`{|}~—‘“”…、。【】\u4E00-\u9FA5！（），：；？￥-]/g
  return !reg.test(String(value))
}
